package com.example.doctor.service;
import com.alibaba.dubbo.config.annotation.Service;
import com.example.mapper.FreeQuestionMapper;
import com.example.mapper.GdCommentMapper;
import com.example.mapper.GdDoctorMapper;
import com.example.pojo.FreeQuestion;
import com.example.pojo.GdComment;
import com.example.service.RpcCommentService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * Created by LENOVO on 2018/9/26.
 */
@Component
@Service(interfaceClass = RpcCommentService.class)
public class RpcCommentServiceImpl implements RpcCommentService {

    @Resource
    private GdCommentMapper gdCommentMapper;
    @Resource
    private FreeQuestionMapper freeQuestionMapper;
    @Override
    public List<GdComment> getCommentList(String doctorId) throws Exception {
        return gdCommentMapper.selectCommentList(Long.parseLong(doctorId));
    }

    @Override
    public int saveQuestion(FreeQuestion freeQuestion) {
        return freeQuestionMapper.insertSelective(freeQuestion);
    }
}
